package com.szpx.controller.ZRZController;

import com.szpx.entity.ZRZ.xueyuanXX;
import com.szpx.service.xueyuanXXService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 1.测试前端使用Ajax向后台发送JSON数据，后台接收到数据。
 * 2.后台使用JSON解析前端传过来的数据后返回JSON数据给前端展示。
 */
@Controller
@RequestMapping("/zrz")
public class baomingXXGLController {
    @Autowired
    private xueyuanXXService xueyuanXXService;

    



    @RequestMapping("/baomingXXGL")
    public String userHuiHuiTestLayui(HttpSession session, Model model) {
        List<xueyuanXX> xueyuanXXList = xueyuanXXService.selectAllxueyuanXX();
        System.out.println(xueyuanXXList.toString());
        model.addAttribute("hi",xueyuanXXList);
//        D:\demo\src\main\resources\templates\lishihuiTeacherHtml\lishihuiAjaxHtml\huihui.html
        return "ZRZ/baomingXXGL.html";
    }


}
